#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;

int s(int x) {
    if (x == 0) return 1;
    if (x % 2 == 0) return s(x / 2);
    if (x % 2 == 1) return s(x - 1) + 1;
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int x; cin >> x;
    cout << s(x) << '\n';
    return 0;
}